/*
 * @Description: 互斥线程锁头文件
 * @Author: iwonmo
 * @Date: 2021-06-29 14:42:16
 */

#include "other.h"
#include <pthread.h>
#include "php.h"
#include "zend.h"
#include <sys/mman.h>

static pthread_mutexattr_t io_lock_attr; /* 互斥锁的属性 */
static zend_bool io_lock_ready = 0;      /* 互斥锁是否准备好 */
static pthread_condattr_t condAttr;      /* 等待条件变量属性 */
/* 导出函数 */
extern int io_mutex_init();
extern void io_mutex_cleanup();
extern int io_mutex_lock(pthread_mutex_t *mutex, pthread_cond_t *cond);
extern int io_mutex_unlock(pthread_mutex_t *mutex, pthread_cond_t *cond);
extern int io_mutex_wait(pthread_mutex_t *mutex, pthread_cond_t *cond, int m);
extern char *getMem(char *name);
extern pthread_cond_t *getCond(char *Mem);